package com.lu.mapper;

import com.lu.entity.User;
import org.apache.ibatis.annotations.*;

import java.util.List;
@Mapper
public interface UserMapper {

    //查询用户名，密码,邮箱
    @Select("select username,password,email from user")
    List<User> query();

    //插入数据
    @Insert("insert into user(username,password,email,created_time) values (#{username},#{password},#{email},#{createdTime})")
    void insert(User user);

    //查询用户名
    @Select("select username from user")
    String[] username();

    //修改密码
    @Update("update user set password = #{password} where username = #{username}")
    void updatePassword(User user);
}
